﻿using System;

namespace Minecraft.Map.Converters
{
	public class DimensionConverter : NamedBinaryTag.Converters.TagPathValueConverter
	{
		public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			object convertedValue = base.Convert(value, targetType, parameter, culture);
			if ((convertedValue == parameter) || (convertedValue == (object)MissingParameter) || (convertedValue == null))
				return convertedValue;
			int realValue = (byte)convertedValue;
			switch (realValue)
			{
				case 0:
					return "Overworld";
				case -1:
					return "Nether";
			}
			return string.Format("Unknown Dimension {0}.", realValue);
		}
	}
}
